<?php

use yii\helpers\Html;
use execut\widget\TreeView;
use backend\helpers\TreeViewFormatterHelper;
use backend\helpers\ActionButton;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\PageSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Страницы';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="container page-index">

    <h1  class="main-title"><?= Html::encode($this->title) ?> деревом | <?= Html::a('Страницы списком', ['page/index-list']) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <div class="action-menu action-menu__container">
        <div>
            <?= ActionButton::create('Создать страницу', 'createPage') ?>
        </div>
        <div>
            <?= ActionButton::dictionaryLink('Редиректы', 'page-redirect/index', 'browsePageRedirect');?>
        </div>
    </div>

    <br>
    <h2 class="main-title">Выставочный комплекс Салют, победа!</h2>

    <?= TreeView::widget([
        'id' => 'tree',
        'data' => [TreeViewFormatterHelper::formatNode($pagesTreeProvider)],
        'header' => 'Страницы сайта',
        'searchOptions' => [
            'inputOptions' => [
                'placeholder' => 'Поиск по дереву' . '...'
            ],
        ],
        'clientOptions' => [
            'levels' => 10,
            'showTags' => true,
            'tagsClass' => 'badge',
            'enableLinks' => true,
        ],
    ]) ?>

    <br>
    <h2 class="main-title">Золото Сарматов</h2>

    <?= TreeView::widget([
        'id' => 'zolotoTree',
        'data' => [TreeViewFormatterHelper::formatNode($zolotoTreeProvider)],
        'header' => 'Страницы сайта',
        'searchOptions' => [
            'inputOptions' => [
                'placeholder' => 'Поиск по дереву' . '...'
            ],
        ],
        'clientOptions' => [
            'levels' => 10,
            'showTags' => true,
            'tagsClass' => 'badge',
            'enableLinks' => true,
        ],
    ]) ?>
    
    <br>
    <h2 class="main-title">Ткань времени</h2>

    <?= TreeView::widget([
        'id' => 'tvTree',
        'data' => [TreeViewFormatterHelper::formatNode($tvTreeProvider)],
        'header' => 'Страницы сайта',
        'searchOptions' => [
            'inputOptions' => [
                'placeholder' => 'Поиск по дереву' . '...'
            ],
        ],
        'clientOptions' => [
            'levels' => 10,
            'showTags' => true,
            'tagsClass' => 'badge',
            'enableLinks' => true,
        ],
    ]) ?>
</div>
